3.1.86 \(\int (d+e x)^2 (a+b \log (c x^n))^2 \, dx\) [86]

Optimal. Leaf size=173 \[ 2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}-2 b d^2 n x \left (a+b \log \left (c x^n\right )\right )-b d e n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {2}{9} b e^2 n x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {2 b d^3 n \log (x) \left (a+b \log \left (c x^n\right )\right )}{3 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e} \]

[Out]

2*b^2*d^2*n^2*x+1/2*b^2*d*e*n^2*x^2+2/27*b^2*e^2*n^2*x^3+1/3*b^2*d^3*n^2*ln(x)^2/e-2*b*d^2*n*x*(a+b*ln(c*x^n))
-b*d*e*n*x^2*(a+b*ln(c*x^n))-2/9*b*e^2*n*x^3*(a+b*ln(c*x^n))-2/3*b*d^3*n*ln(x)*(a+b*ln(c*x^n))/e+1/3*(e*x+d)^3
*(a+b*ln(c*x^n))^2/e

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2356, 45, 2372, 2338} \begin {gather*} -\frac {2 b d^3 n \log (x) \left (a+b \log \left (c x^n\right )\right )}{3 e}-2 b d^2 n x \left (a+b \log \left (c x^n\right )\right )+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}-b d e n x^2 \left (a+b \log \left (c x^n\right )\right )-\frac {2}{9} b e^2 n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}+2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x)^2*(a + b*Log[c*x^n])^2,x]

[Out]

2*b^2*d^2*n^2*x + (b^2*d*e*n^2*x^2)/2 + (2*b^2*e^2*n^2*x^3)/27 + (b^2*d^3*n^2*Log[x]^2)/(3*e) - 2*b*d^2*n*x*(a
 + b*Log[c*x^n]) - b*d*e*n*x^2*(a + b*Log[c*x^n]) - (2*b*e^2*n*x^3*(a + b*Log[c*x^n]))/9 - (2*b*d^3*n*Log[x]*(
a + b*Log[c*x^n]))/(3*e) + ((d + e*x)^3*(a + b*Log[c*x^n])^2)/(3*e)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2356

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)
*((a + b*Log[c*x^n])^p/(e*(q + 1))), x] - Dist[b*n*(p/(e*(q + 1))), Int[((d + e*x)^(q + 1)*(a + b*Log[c*x^n])^
(p - 1))/x, x], x] /; FreeQ[{a, b, c, d, e, n, p, q}, x] && GtQ[p, 0] && NeQ[q, -1] && (EqQ[p, 1] || (Integers
Q[2*p, 2*q] &&  !IGtQ[q, 0]) || (EqQ[p, 2] && NeQ[q, 1]))

Rule 2372

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]]
 /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rubi steps

\begin {align*} \int (d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}-\frac {(2 b n) \int \frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )}{x} \, dx}{3 e}\\ &=-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}+\frac {\left (2 b^2 n^2\right ) \int \left (\frac {1}{6} e \left (18 d^2+9 d e x+2 e^2 x^2\right )+\frac {d^3 \log (x)}{x}\right ) \, dx}{3 e}\\ &=-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}+\frac {1}{9} \left (b^2 n^2\right ) \int \left (18 d^2+9 d e x+2 e^2 x^2\right ) \, dx+\frac {\left (2 b^2 d^3 n^2\right ) \int \frac {\log (x)}{x} \, dx}{3 e}\\ &=2 b^2 d^2 n^2 x+\frac {1}{2} b^2 d e n^2 x^2+\frac {2}{27} b^2 e^2 n^2 x^3+\frac {b^2 d^3 n^2 \log ^2(x)}{3 e}-\frac {b n \left (18 d^2 e x+9 d e^2 x^2+2 e^3 x^3+6 d^3 \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )}{9 e}+\frac {(d+e x)^3 \left (a+b \log \left (c x^n\right )\right )^2}{3 e}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 135, normalized size = 0.78 \begin {gather*} \frac {2}{27} b e^2 n x^3 \left (-3 a+b n-3 b \log \left (c x^n\right )\right )+\frac {1}{2} b d e n x^2 \left (-2 a+b n-2 b \log \left (c x^n\right )\right )+d^2 x \left (a+b \log \left (c x^n\right )\right )^2+d e x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{3} e^2 x^3 \left (a+b \log \left (c x^n\right )\right )^2-2 b d^2 n x \left (a-b n+b \log \left (c x^n\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x)^2*(a + b*Log[c*x^n])^2,x]

[Out]

(2*b*e^2*n*x^3*(-3*a + b*n - 3*b*Log[c*x^n]))/27 + (b*d*e*n*x^2*(-2*a + b*n - 2*b*Log[c*x^n]))/2 + d^2*x*(a +
b*Log[c*x^n])^2 + d*e*x^2*(a + b*Log[c*x^n])^2 + (e^2*x^3*(a + b*Log[c*x^n])^2)/3 - 2*b*d^2*n*x*(a - b*n + b*L
og[c*x^n])

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.32, size = 2565, normalized size = 14.83

method result size
risch \(\text {Expression too large to display}\) \(2565\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)^2*(a+b*ln(c*x^n))^2,x,method=_RETURNVERBOSE)

[Out]

1/3*a^2*e^2*x^3+x*a^2*d^2+1/6*e^2*Pi^2*b^2*x^3*csgn(I*x^n)*csgn(I*c*x^n)^5-1/4*e*Pi^2*b^2*d*x^2*csgn(I*c*x^n)^
6-1/4*Pi^2*b^2*d^2*csgn(I*c)^2*csgn(I*c*x^n)^4*x+a^2*d*e*x^2+1/3*(e*x+d)^3*b^2/e*ln(x^n)^2-1/4*Pi^2*b^2*d^2*cs
gn(I*c)^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2*x+1/2*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(I*c*x^n)^6*x-2*ln(c)*b^2*d^2*n
*x+2*ln(c)*a*b*d^2*x-2/9*ln(c)*b^2*e^2*n*x^3+ln(c)^2*b^2*d*e*x^2+2/3*ln(c)*a*b*e^2*x^3-1/12*e^2*Pi^2*b^2*x^3*c
sgn(I*c*x^n)^6-1/4*e*Pi^2*b^2*d*x^2*csgn(I*c)^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2+1/2*e*Pi^2*b^2*d*x^2*csgn(I*c)^2
*csgn(I*x^n)*csgn(I*c*x^n)^3+1/2*e*Pi^2*b^2*d*x^2*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3-e*Pi^2*b^2*d*x^2*csg
n(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4+I*Pi*ln(c)*b^2*d^2*csgn(I*c)*csgn(I*c*x^n)^2*x+I*Pi*ln(c)*b^2*d^2*csgn(I*x^
n)*csgn(I*c*x^n)^2*x+1/2*Pi^2*b^2*d^2*csgn(I*c)*csgn(I*c*x^n)^5*x-1/4*Pi^2*b^2*d^2*csgn(I*x^n)^2*csgn(I*c*x^n)
^4*x+1/2*Pi^2*b^2*d^2*csgn(I*x^n)*csgn(I*c*x^n)^5*x-1/12*e^2*Pi^2*b^2*x^3*csgn(I*c)^2*csgn(I*c*x^n)^4+1/6*e^2*
Pi^2*b^2*x^3*csgn(I*c)*csgn(I*c*x^n)^5-1/12*e^2*Pi^2*b^2*x^3*csgn(I*x^n)^2*csgn(I*c*x^n)^4-ln(c)*b^2*d*e*n*x^2
+2*ln(c)*a*b*d*e*x^2

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 235, normalized size = 1.36 \begin {gather*} \frac {1}{3} \, b^{2} x^{3} e^{2} \log \left (c x^{n}\right )^{2} + b^{2} d x^{2} e \log \left (c x^{n}\right )^{2} - \frac {2}{9} \, a b n x^{3} e^{2} - a b d n x^{2} e + \frac {2}{3} \, a b x^{3} e^{2} \log \left (c x^{n}\right ) + 2 \, a b d x^{2} e \log \left (c x^{n}\right ) + b^{2} d^{2} x \log \left (c x^{n}\right )^{2} - 2 \, a b d^{2} n x + \frac {1}{3} \, a^{2} x^{3} e^{2} + a^{2} d x^{2} e + 2 \, a b d^{2} x \log \left (c x^{n}\right ) + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d^{2} + a^{2} d^{2} x + \frac {1}{2} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} d e + \frac {2}{27} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} e^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/3*b^2*x^3*e^2*log(c*x^n)^2 + b^2*d*x^2*e*log(c*x^n)^2 - 2/9*a*b*n*x^3*e^2 - a*b*d*n*x^2*e + 2/3*a*b*x^3*e^2*
log(c*x^n) + 2*a*b*d*x^2*e*log(c*x^n) + b^2*d^2*x*log(c*x^n)^2 - 2*a*b*d^2*n*x + 1/3*a^2*x^3*e^2 + a^2*d*x^2*e
 + 2*a*b*d^2*x*log(c*x^n) + 2*(n^2*x - n*x*log(c*x^n))*b^2*d^2 + a^2*d^2*x + 1/2*(n^2*x^2 - 2*n*x^2*log(c*x^n)
)*b^2*d*e + 2/27*(n^2*x^3 - 3*n*x^3*log(c*x^n))*b^2*e^2

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 331 vs. \(2 (159) = 318\).
time = 0.38, size = 331, normalized size = 1.91 \begin {gather*} \frac {1}{27} \, {\left (2 \, b^{2} n^{2} - 6 \, a b n + 9 \, a^{2}\right )} x^{3} e^{2} + \frac {1}{2} \, {\left (b^{2} d n^{2} - 2 \, a b d n + 2 \, a^{2} d\right )} x^{2} e + \frac {1}{3} \, {\left (b^{2} x^{3} e^{2} + 3 \, b^{2} d x^{2} e + 3 \, b^{2} d^{2} x\right )} \log \left (c\right )^{2} + \frac {1}{3} \, {\left (b^{2} n^{2} x^{3} e^{2} + 3 \, b^{2} d n^{2} x^{2} e + 3 \, b^{2} d^{2} n^{2} x\right )} \log \left (x\right )^{2} + {\left (2 \, b^{2} d^{2} n^{2} - 2 \, a b d^{2} n + a^{2} d^{2}\right )} x - \frac {1}{9} \, {\left (2 \, {\left (b^{2} n - 3 \, a b\right )} x^{3} e^{2} + 9 \, {\left (b^{2} d n - 2 \, a b d\right )} x^{2} e + 18 \, {\left (b^{2} d^{2} n - a b d^{2}\right )} x\right )} \log \left (c\right ) - \frac {1}{9} \, {\left (2 \, {\left (b^{2} n^{2} - 3 \, a b n\right )} x^{3} e^{2} + 9 \, {\left (b^{2} d n^{2} - 2 \, a b d n\right )} x^{2} e + 18 \, {\left (b^{2} d^{2} n^{2} - a b d^{2} n\right )} x - 6 \, {\left (b^{2} n x^{3} e^{2} + 3 \, b^{2} d n x^{2} e + 3 \, b^{2} d^{2} n x\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/27*(2*b^2*n^2 - 6*a*b*n + 9*a^2)*x^3*e^2 + 1/2*(b^2*d*n^2 - 2*a*b*d*n + 2*a^2*d)*x^2*e + 1/3*(b^2*x^3*e^2 +
3*b^2*d*x^2*e + 3*b^2*d^2*x)*log(c)^2 + 1/3*(b^2*n^2*x^3*e^2 + 3*b^2*d*n^2*x^2*e + 3*b^2*d^2*n^2*x)*log(x)^2 +
 (2*b^2*d^2*n^2 - 2*a*b*d^2*n + a^2*d^2)*x - 1/9*(2*(b^2*n - 3*a*b)*x^3*e^2 + 9*(b^2*d*n - 2*a*b*d)*x^2*e + 18
*(b^2*d^2*n - a*b*d^2)*x)*log(c) - 1/9*(2*(b^2*n^2 - 3*a*b*n)*x^3*e^2 + 9*(b^2*d*n^2 - 2*a*b*d*n)*x^2*e + 18*(
b^2*d^2*n^2 - a*b*d^2*n)*x - 6*(b^2*n*x^3*e^2 + 3*b^2*d*n*x^2*e + 3*b^2*d^2*n*x)*log(c))*log(x)

________________________________________________________________________________________

Sympy [A]
time = 0.31, size = 286, normalized size = 1.65 \begin {gather*} a^{2} d^{2} x + a^{2} d e x^{2} + \frac {a^{2} e^{2} x^{3}}{3} - 2 a b d^{2} n x + 2 a b d^{2} x \log {\left (c x^{n} \right )} - a b d e n x^{2} + 2 a b d e x^{2} \log {\left (c x^{n} \right )} - \frac {2 a b e^{2} n x^{3}}{9} + \frac {2 a b e^{2} x^{3} \log {\left (c x^{n} \right )}}{3} + 2 b^{2} d^{2} n^{2} x - 2 b^{2} d^{2} n x \log {\left (c x^{n} \right )} + b^{2} d^{2} x \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} d e n^{2} x^{2}}{2} - b^{2} d e n x^{2} \log {\left (c x^{n} \right )} + b^{2} d e x^{2} \log {\left (c x^{n} \right )}^{2} + \frac {2 b^{2} e^{2} n^{2} x^{3}}{27} - \frac {2 b^{2} e^{2} n x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {b^{2} e^{2} x^{3} \log {\left (c x^{n} \right )}^{2}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)**2*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*d**2*x + a**2*d*e*x**2 + a**2*e**2*x**3/3 - 2*a*b*d**2*n*x + 2*a*b*d**2*x*log(c*x**n) - a*b*d*e*n*x**2 +
2*a*b*d*e*x**2*log(c*x**n) - 2*a*b*e**2*n*x**3/9 + 2*a*b*e**2*x**3*log(c*x**n)/3 + 2*b**2*d**2*n**2*x - 2*b**2
*d**2*n*x*log(c*x**n) + b**2*d**2*x*log(c*x**n)**2 + b**2*d*e*n**2*x**2/2 - b**2*d*e*n*x**2*log(c*x**n) + b**2
*d*e*x**2*log(c*x**n)**2 + 2*b**2*e**2*n**2*x**3/27 - 2*b**2*e**2*n*x**3*log(c*x**n)/9 + b**2*e**2*x**3*log(c*
x**n)**2/3

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 385 vs. \(2 (159) = 318\).
time = 2.84, size = 385, normalized size = 2.23 \begin {gather*} \frac {1}{3} \, b^{2} n^{2} x^{3} e^{2} \log \left (x\right )^{2} + b^{2} d n^{2} x^{2} e \log \left (x\right )^{2} - \frac {2}{9} \, b^{2} n^{2} x^{3} e^{2} \log \left (x\right ) - b^{2} d n^{2} x^{2} e \log \left (x\right ) + \frac {2}{3} \, b^{2} n x^{3} e^{2} \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n x^{2} e \log \left (c\right ) \log \left (x\right ) + b^{2} d^{2} n^{2} x \log \left (x\right )^{2} + \frac {2}{27} \, b^{2} n^{2} x^{3} e^{2} + \frac {1}{2} \, b^{2} d n^{2} x^{2} e - \frac {2}{9} \, b^{2} n x^{3} e^{2} \log \left (c\right ) - b^{2} d n x^{2} e \log \left (c\right ) + \frac {1}{3} \, b^{2} x^{3} e^{2} \log \left (c\right )^{2} + b^{2} d x^{2} e \log \left (c\right )^{2} - 2 \, b^{2} d^{2} n^{2} x \log \left (x\right ) + \frac {2}{3} \, a b n x^{3} e^{2} \log \left (x\right ) + 2 \, a b d n x^{2} e \log \left (x\right ) + 2 \, b^{2} d^{2} n x \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d^{2} n^{2} x - \frac {2}{9} \, a b n x^{3} e^{2} - a b d n x^{2} e - 2 \, b^{2} d^{2} n x \log \left (c\right ) + \frac {2}{3} \, a b x^{3} e^{2} \log \left (c\right ) + 2 \, a b d x^{2} e \log \left (c\right ) + b^{2} d^{2} x \log \left (c\right )^{2} + 2 \, a b d^{2} n x \log \left (x\right ) - 2 \, a b d^{2} n x + \frac {1}{3} \, a^{2} x^{3} e^{2} + a^{2} d x^{2} e + 2 \, a b d^{2} x \log \left (c\right ) + a^{2} d^{2} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/3*b^2*n^2*x^3*e^2*log(x)^2 + b^2*d*n^2*x^2*e*log(x)^2 - 2/9*b^2*n^2*x^3*e^2*log(x) - b^2*d*n^2*x^2*e*log(x)
+ 2/3*b^2*n*x^3*e^2*log(c)*log(x) + 2*b^2*d*n*x^2*e*log(c)*log(x) + b^2*d^2*n^2*x*log(x)^2 + 2/27*b^2*n^2*x^3*
e^2 + 1/2*b^2*d*n^2*x^2*e - 2/9*b^2*n*x^3*e^2*log(c) - b^2*d*n*x^2*e*log(c) + 1/3*b^2*x^3*e^2*log(c)^2 + b^2*d
*x^2*e*log(c)^2 - 2*b^2*d^2*n^2*x*log(x) + 2/3*a*b*n*x^3*e^2*log(x) + 2*a*b*d*n*x^2*e*log(x) + 2*b^2*d^2*n*x*l
og(c)*log(x) + 2*b^2*d^2*n^2*x - 2/9*a*b*n*x^3*e^2 - a*b*d*n*x^2*e - 2*b^2*d^2*n*x*log(c) + 2/3*a*b*x^3*e^2*lo
g(c) + 2*a*b*d*x^2*e*log(c) + b^2*d^2*x*log(c)^2 + 2*a*b*d^2*n*x*log(x) - 2*a*b*d^2*n*x + 1/3*a^2*x^3*e^2 + a^
2*d*x^2*e + 2*a*b*d^2*x*log(c) + a^2*d^2*x

________________________________________________________________________________________

Mupad [B]
time = 3.49, size = 166, normalized size = 0.96 \begin {gather*} {\ln \left (c\,x^n\right )}^2\,\left (b^2\,d^2\,x+b^2\,d\,e\,x^2+\frac {b^2\,e^2\,x^3}{3}\right )+\ln \left (c\,x^n\right )\,\left (2\,b\,\left (a-b\,n\right )\,d^2\,x+b\,\left (2\,a-b\,n\right )\,d\,e\,x^2+\frac {2\,b\,\left (3\,a-b\,n\right )\,e^2\,x^3}{9}\right )+d^2\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right )+\frac {e^2\,x^3\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{27}+\frac {d\,e\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*x^n))^2*(d + e*x)^2,x)

[Out]

log(c*x^n)^2*(b^2*d^2*x + (b^2*e^2*x^3)/3 + b^2*d*e*x^2) + log(c*x^n)*((2*b*e^2*x^3*(3*a - b*n))/9 + 2*b*d^2*x
*(a - b*n) + b*d*e*x^2*(2*a - b*n)) + d^2*x*(a^2 + 2*b^2*n^2 - 2*a*b*n) + (e^2*x^3*(9*a^2 + 2*b^2*n^2 - 6*a*b*
n))/27 + (d*e*x^2*(2*a^2 + b^2*n^2 - 2*a*b*n))/2

________________________________________________________________________________________